package com.hsteach.web.controller.activity;

import java.util.List;

import com.hsteach.common.core.controller.BaseController;
import com.hsteach.common.core.domain.AjaxResult;
import com.hsteach.common.core.page.TableDataInfo;
import com.hsteach.dao.domain.activity.ActivityEnroll;
import com.hsteach.service.activity.ActivityEnrollService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 活动报名人员Controller
 * 弃用
 * @author fanxquer
 * @date 2023-07-11
 */
@RestController
@RequestMapping("/enroll/enroll")
@Deprecated
public class ActivityEnrollController extends BaseController
{
    @Autowired
    private ActivityEnrollService activityEnrollService;

    /**
     * 查询活动报名人员列表
     */
    @GetMapping("/list")
    public TableDataInfo list(ActivityEnroll activityEnroll)
    {
        startPage();
        List<ActivityEnroll> list = activityEnrollService.selectTbActivityEnrollList(activityEnroll);
        return getDataTable(list);
    }

    /**
     * 获取活动报名人员详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(activityEnrollService.selectTbActivityEnrollById(id));
    }

    /**
     * 新增活动报名人员
     */
    @PostMapping
    public AjaxResult add(@RequestBody ActivityEnroll activityEnroll)
    {
        return toAjax(activityEnrollService.insertTbActivityEnroll(activityEnroll));
    }

    /**
     * 修改活动报名人员
     */
    @PutMapping
    public AjaxResult edit(@RequestBody ActivityEnroll activityEnroll)
    {
        return toAjax(activityEnrollService.updateTbActivityEnroll(activityEnroll));
    }

    /**
     * 删除活动报名人员
     */
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(activityEnrollService.deleteTbActivityEnrollByIds(ids));
    }
}
